package com.yzt.zhuju.utils;

/**
 * author : bob
 * date   : 2022/12/7
 * desc   : 连续点击检测
 */
public class FastClickUtils {

    /**
     * 上次点击的时间
     */
    private static long lastClickTime = 0;

    /**
     * 时间间隔
     */
    private final static int spaceTime = 500;

    public static boolean isFastClick() {
        long currentTime = System.currentTimeMillis();
        boolean isFastClick;//是否快速点击
        isFastClick = currentTime - lastClickTime <= spaceTime;
        lastClickTime = currentTime;
        return isFastClick;
    }
}
